#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n;
    cin>>n;
    for (int p=1;n!=0;p++)
    {
        vector<string>people(n);
        vector<string>copy(n);
        for (int i=0;i<n;i++)
        {   
            cin>>people[i];
        }
        for (int i=0;i<n/2;i++)
        {
            copy[i]=people[i*2];
            copy[n-1-i]=people[i*2+1];
        }
        if (n%2!=0)
        {
            copy[(n-1)/2]=people[n-1];
        }
        printf("SET %d\n",p);
        for (string i:copy)
            cout<<i<<endl;
        cin>>n;
    }
}